#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main()
{
    FILE *fp;
    fp=0;
    if((fp=fopen("/home/hc/Linux_ARM/Linux多线程/13.2聊天室(注册登陆) /user.txt","a"))==0)
    {
        printf("文件打开失败!\n");
        return -1;
    }
    char *strBuf=(char*)malloc(40);
    strcpy(strBuf,"zhangsan 1234\n");

    fprintf(fp,"%s",strBuf);

    fclose(fp);
    strBuf=NULL;
}



